package com.prs.crm.context;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;

/**
 * 常用数据builder
 * @author prs.chenzhi
 *
 */
public class DataBuilder {

	/**
	 * 获取一个时间范围
	 * @param ahead 提前
	 * @param limit
	 * @return
	 */
	public static  Collection<Integer> buildYearArea(int ahead ,int limit)
	{
		
		
		Collection<Integer> years = new ArrayList<Integer>();
		Calendar c = Calendar.getInstance(); 
		c.setTime(new java.util.Date()); 
		int year = c.get(Calendar.YEAR)-ahead;
		for (int i=0;i<limit;i++)
		{
		
			years.add(year++);  
		
		}
		
		   return years;
		
		   
	 }
	
	public static Collection<Integer> buildMonthArea()
	{
		Collection<Integer> months = new ArrayList<Integer>();
		for (int i=1;i<=12;)months.add(i++);
		return months;
	}
}
